<?php

class FrontendUser extends sfBasicSecurityUser
{
  public function getReadPosts()
  {
    return $this->getAttribute('read_posts');
  }
  
  public function setReadPosts($posts)
  {
    return $this->setAttribute('read_posts', $posts);
  }
  
  public function hasRead($id)
  {
    return in_array($id, $this->getReadPosts());
  }

  public function read($id)
  {
    $posts = $this->getReadPosts();
    $posts[] = $id;
    $this->setReadPosts($posts);
  }
}
